﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using tmAsk.Common;

namespace tmAsk.Manager
{
    public partial class Admin_User_search : System.Web.UI.Page
    {
        function make_htm = new function();
        protected void Page_Load(object sender, EventArgs e)
        {
            string type = Request.QueryString["type"];
            string key = Request.QueryString["key"].Trim();
            string sqlstr = "1=1 ";
            if ("user" == type)
            {
                if (key != null)
                {
                    sqlstr = "(u_email like '%" + key + "%' or u_nickname like '%" + key + "%')";
                }
            }
            string page = Request["page"];
            int pageindex = 1;
            if (page == null || page == "")
            {
                pageindex = 1;
            }
            else
            {
                pageindex = Convert.ToInt32(page);
            }
            string html = "";
            string template_url = Server.MapPath("template/t_admin_user_search.html");
            html = make_htm.Get_page(template_url, "[sqlstr]", sqlstr, "", pageindex, "?template=" + template_url + "&key=" + key + "&type=user&page=");
            Response.Write(html);
        }
    }
}